package buttons;

import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.geom.Circle;

public class StateLight {
	Color on,off,edge;
	boolean state=false;
	int x,y,r;
	
	public StateLight(int x, int y){
		this.x=x; this.y=y;
		on=Color.green; off=Color.red; edge=Color.gray; r=2;
	}
	public StateLight(int x, int y, int R, Color ON, Color OFF, Color EDGE){
		this.x=x; this.y=y;
		on=ON; off=OFF; edge=EDGE; r=R;
	}
	public void update(boolean s){
		state=s;
	}
	public void draw(Graphics g){
		if(state){
			g.setColor(on);
		}else{g.setColor(off);}
		g.fill(new Circle(x,y,r));
		g.setLineWidth(2);
		g.setColor(edge);
		g.draw(new Circle(x,y,r));
		g.setLineWidth(1);
	}
}
